cmake_minimum_required (VERSION 3.10)

project(example_hiredis)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

custom_find_library(event)
custom_find_library(hiredis)

if(event_FOUND AND hiredis_FOUND)
    aux_source_directory(. DIR_SOURCES)

    add_executable (${PROJECT_NAME} ${DIR_SOURCES})
    target_link_libraries(${PROJECT_NAME} glog::glog)
    target_link_libraries(${PROJECT_NAME} pthread)
    target_link_libraries(${PROJECT_NAME} hiredis)
    target_link_libraries(${PROJECT_NAME} event_core)
    target_link_libraries(${PROJECT_NAME} event_pthreads)
endif()
